@extends('Admin.layout.layout')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <div class="col-sm-11">
                            <h5>订单详情</h5>
                        </div>
                        <div class="col-sm-1">
                            <div class="bottom-con">
                                <a class ="btn btn-s-m btn-default" href="{{asset('/foradmin/order')}}">返回</a>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-md-4 col-zdlg-2-5 text-center dq">
                                生成订单
                            </div>
                            <div class="col-md-4 col-zdlg-2-5 text-center {{array_get($order, 'pay_at') ? 'dq' : ''}}">
                                完成付款
                            </div>
                            <div class="col-md-4 col-zdlg-2-5 text-center {{array_get($order, 'shipments_at') ? 'dq' : ''}}">
                                商家发货
                            </div>
                            <div class="col-md-4 col-zdlg-2-5 text-center {{array_get($order, 'confirm_at') ? 'dq' : ''}}">
                                收货确认
                            </div>
                            <div class="col-md-4 col-zdlg-2-5 text-center {{array_get($order, 'comment_at') ? 'dq' : ''}}">
                                完成评论
                            </div>
                        </div>

                        <form class="form-horizontal m-t" id="signupForm">
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <div class="tabs-container">
                                        <ul class="nav nav-tabs">
                                            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 订单详情</a>
                                            </li>
                                        </ul>
                                        <div class="tab-content">
                                            <div id="tab-1" class="tab-pane active">
                                                <div class="panel-body">
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">店铺名称：{{arr_get($order, 'shop.sp_name')}}</p>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">订单状态：{{arr_get($order, 'order_status_name')}}</p>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">订单号：{{arr_get($order, 'order_code')}}</p>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">下单时间：{{arr_get($order, 'order_at')}}</p>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">订单总额：￥{{arr_get($order, 'order_money')}}</p>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <p class="form-control-static">运费：￥{{arr_get($order, 'freight')}}</p>
                                                    </div>
                                                    <table class="table table-bordered text-center">
                                                        <thead>
                                                            <tr>
                                                                <th width="80" style="border-right:0;"></th>
                                                                <th width="250" style="border-left:0;">订单商品</th>
                                                                <th class="text-center">状态</th>
                                                                <th class="text-center">单价</th>
                                                                <th class="text-center">数量</th>
                                                                <th class="text-center">优惠</th>
                                                                {{--<th class="text-center">运费</th>--}}
                                                                <th class="text-center">总价</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                        @if(array_get($order, 'order_products'))
                                                            @foreach(array_get($order, 'order_products') as $order_product)
                                                            <tr>
                                                                <td style="border-right:0;">
                                                                    <img width="60" src="{{array_get($order_product, 'product_img_url')}}">
                                                                </td>
                                                                <td style="border-left:0;">{{arr_get($order_product, 'product_name')}}</td>
                                                                <td>{{arr_get($order, 'order_status_name')}}</td>
                                                                <td class="text-danger">￥{{arr_get($order_product, 'product_price')}}</td>
                                                                <td>{{arr_get($order_product, 'quantity')}}</td>
                                                                <td>￥{{arr_get($order_product, 'discount_money')}}</td>
{{--                                                                <td>￥{{arr_get($order, 'freight')}}</td>--}}
                                                                <td class="text-danger">￥{{arr_get($order_product, 'product_money')}}</td>
                                                            </tr>
                                                            @endforeach
                                                         @endif
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <h5>购买/收货方信息</h5>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">买家：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'receiver')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">联系方式：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'phone')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">收货地址：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'address')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">发票信息：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'is_claim_invoice_name')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">买家留言：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'remark')}}</p>
                                </div>
                            </div>
                            <h5>销售/发货方信息</h5>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">店铺：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'shop.company_name')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">店主名称：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">-</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">联系电话：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'order.phone')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">发货地址：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'order.address')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">发货时间：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'shipments_at')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">快递公司：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'order_express.express_company')}}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">物流单号：</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{arr_get($order, 'order_express.waybill_number')}}</p>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <script type="text/javascript" src="{{asset('/js/contabs.js')}}"></script>

    <!-- jQuery Validation plugin javascript-->
    <script src="{{asset('js/plugins/validate/jquery.validate.min.js')}}"></script>
    <script src="{{asset('js/plugins/validate/messages_zh.min.js')}}"></script>
    <script src="{{asset('js/plugins/staps/jquery.steps.min.js')}}"></script>
    <script>
        $(document).ready(function () {
            $("#wizard").steps();
        });
    </script>
@endsection
